package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteChanceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * 视频号详情服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteChanceFallbackFactory implements FallbackFactory<RemoteChanceService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteChanceFallbackFactory.class);

    @Override
    public RemoteChanceService create(Throwable throwable)
    {
        log.error("视频号详情:{}", throwable.getMessage());
        return new RemoteChanceService()
        {
            @Override
            public String finderDetail(HashMap<String,Object> map) {
                return null;
            }

        };
    }
}
